package com.imachen.ymcc.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.imachen.ymcc.domain.UserCode;
import com.imachen.ymcc.mapper.UserCodeMapper;
import com.imachen.ymcc.service.IUserCodeService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author imachen
 * @since 2022-10-04
 */
@Service
public class UserCodeServiceImpl extends ServiceImpl<UserCodeMapper, UserCode> implements IUserCodeService {

    @Override
    public UserCode selectCodeByUserId(Long userId) {
        Wrapper<UserCode> wrapper = new EntityWrapper<>();
        wrapper.eq("user_id",userId);
        UserCode userCode = selectOne(wrapper);
        return userCode;
    }
}
